Account Balances By As Of Dates
Data storage class to hold account balances (either by as-of dates or for current/future balances) (within TotalAmount objects). When supplied, the order of the list of asOfDates is always preserved.
The instance will be pre-initialized with all accounts, and depending on outOfDateNull all balances will either be preset to null or a TotalAmount object holding zero. It is the responsibility of any code that instantiates this class to properly populate all balances.
Note: The NetWorthCalculator does not enable outOfDateNull and it's guaranteed that as-of balance(s) (TotalAmount objects) will be initialized and never null.
Since
MD2027
Constructors
Create empty data storage instance to hold account balances by as-of dates.
Properties
The balance type to obtain balances for when not using as-of dates (i.e. today/future balance) (or use asOfDates parameter).
Provides the minimum and maximum dates from transaction and account start dates used within this networth calculation. Will return null when the calculation has not yet executed, or when calculating the current/future balance as-of today (i.e. as-of null) Typically useful when graphing balances over time
When true, null values will be returned (instead of zero) if an account did not exist on a specific as-of date.
Functions
Add an amount to an account's balance when using current/future (no as-of date), or with a single as-of date
Add an amount to a balance for a given account and as-of date (also initialize the as-of date balance if required)
Return the min/max DateRange for a single account (or null if none recorded) - @since MD2027
Return a map of all accounts (within this object) => their min/max DateRange - @since MD2027
Retrieves an account's balance (TotalAmount object) (when using current/future (no as-of date), or with a single as-of date) in the account's own currency. Will return null if the account requested is not present Can return null when outOfDateNull is enabled and where the account did not exist on the as-of date specified
Retrieves an account's balance (TotalAmount object) for the given as-of date, in the account's own currency. Will return null if the account / as-of date requested is not present Can return null when outOfDateNull is enabled and where the account did not exist on the as-of date specified
Retrieves an unmodifiable list of all balances (TotalAmount objects) for a given account, for all as-of dates (will return null if the account is not present). Individual balances will be in the account's local currency, and can be null when outOfDateNull is enabled and where the account did not exist on the as-of date specified.
Retrieves an unmodifiable list of all balances (TotalAmount objects) for a given account, for all as-of dates (will return null if the account is not present). The balances will be converted from the account's currency to the targetCurrency (using the rate on each balance's as-of date). When asOfDates is null (for today/future balance) then the current rate is used. Individual balances can be null when outOfDateNull is enabled and where the account did not exist on the as-of date specified
Totals up all the balances, over all the accounts (when using current/future (no as-of date), or with a single as-of date), and returns a TotalAmount object containing the balance in the requested currency. Will return null if the as-of date is not present Can return null when using outOfDateNull and where none of the accounts existed on the as-of date
Totals up all the balances, over all the accounts, for the given as-of date, and returns a TotalAmount object containing the balance in the requested currency. Will return null if the as-of date is not present Can return null when using outOfDateNull and where none of the accounts existed on the as-of date
Totals balances by as-of date (or the single current/future balance) across all accounts, returning an unmodifiable list of balances (TotalAmount objects) by as-of date. If only current/future balance is being calculated (with no as-of dates) then a single entry will be returned in the list representing this balance. The (as-of date) order and size of the list are both guaranteed to match the original list of dates specified. Individual as-of date balance entries can be null only when using outOfDateNull and where none of the accounts existed on the specific as-of date
Updates the min/max date fields - can be called whenever an account start date or transaction is included within the net worth calculation